/*
 * Copyright (C), 2002-2016, 苏宁易购电子商务有限公司
 * FileName: ModelProbVo.java
 * Author:   13075787
 * Date:     2016年7月4日 上午10:38:09
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.intf.model;

import org.apache.commons.lang3.StringUtils;

/**
 * 样机管理<br>
 * 样机管理样机异常原因
 *
 * @author 13075787
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class ModelProbVo {

    private static final int NUM_ZERO = 0;

    /**
     * 商品编码9位
     */
    private String commCode;
    /**
     * 商品名称
     */
    private String commName;
    /**
     * 实际清单中数量
     */
    private Integer actualNum;
    /**
     * 处理结果，处理数量为空则写0
     */
    private Integer commNum;
    /**
     * 本次盘点数量 数据库小于0的话，则为未盘点到
     */
    private Integer checkCommNum;
    /**
     * 本次盘点结果
     */
    private String checkResult;
    /**
     * 库位编码
     */
    private String storageCode;
    /**
     * 处理原因编码
     */
    private String reasonCode;
    /**
     * 处理原因文本描述
     */
    private String reasonStr;
    /**
     * 真实出样商品编码
     */
    private String actualCommCode;

    /**
     * @return the commCode
     */
    public String getCommCode() {
        return commCode;
    }

    /**
     * @param commCode the commCode to set
     */
    public void setCommCode(String commCode) {
        this.commCode = commCode;
    }

    /**
     * @return the commName
     */
    public String getCommName() {
        return commName;
    }

    /**
     * @param commName the commName to set
     */
    public void setCommName(String commName) {
        this.commName = commName;
    }

    /**
     * @return the actualNum
     */
    public Integer getActualNum() {
        return actualNum;
    }

    /**
     * @param actualNum the actualNum to set
     */
    public void setActualNum(Integer actualNum) {
        this.actualNum = actualNum;
    }

    /**
     * @return the commNum
     */
    public Integer getCommNum() {
        return commNum;
    }

    /**
     * @param commNum the commNum to set
     */
    public void setCommNum(Integer commNum) {
        if (null == commNum) {
            commNum = NUM_ZERO;
        }
        this.commNum = commNum;
    }

    /**
     * @return the checkResult
     */
    public String getCheckResult() {
        return checkResult;
    }

    /**
     * @param checkResult the checkResult to set
     */
    public void setCheckResult(String checkResult) {
        this.checkResult = checkResult;
    }

    /**
     * @return the storageCode
     */
    public String getStorageCode() {
        return storageCode;
    }

    /**
     * @param storageCode the storageCode to set
     */
    public void setStorageCode(String storageCode) {
        this.storageCode = storageCode;
    }

    /**
     * @return the reasonCode
     */
    public String getReasonCode() {
        return reasonCode;
    }

    /**
     * @param reasonCode the reasonCode to set
     */
    public void setReasonCode(String reasonCode) {
        if (StringUtils.isNotBlank(reasonCode)) {
            this.setReasonStr(ModelConstant.getProbReasonValue(reasonCode));
        }
        this.reasonCode = reasonCode;
    }

    /**
     * @return the reasonStr
     */
    public String getReasonStr() {
        if (StringUtils.isBlank(this.reasonStr) && StringUtils.isNotBlank(this.reasonCode)) {
            this.setReasonStr(ModelConstant.getProbReasonValue(this.reasonCode));
        }
        return reasonStr;
    }

    /**
     * @param reasonStr the reasonStr to set
     */
    public void setReasonStr(String reasonStr) {
        this.reasonStr = reasonStr;
    }

    /**
     * @return the actualCommCode
     */
    public String getActualCommCode() {
        return actualCommCode;
    }

    /**
     * @param actualCommCode the actualCommCode to set
     */
    public void setActualCommCode(String actualCommCode) {
        this.actualCommCode = actualCommCode;
    }

    /**
     * @return the checkCommNum
     */
    public Integer getCheckCommNum() {
        return checkCommNum;
    }

    /**
     * @param checkCommNum the checkCommNum to set
     */
    public void setCheckCommNum(Integer checkCommNum) {
        // 若本次盘点数量小于0的话则盘点原因设置为未盘点
        if (null != checkCommNum) {
            if (checkCommNum < NUM_ZERO) {
                this.setCheckResult(ModelConstant.NO_CHECK_RESULT_STR);
            } else {
                this.setCheckResult(String.valueOf(checkCommNum));
            }
        } else {
            this.setCheckResult(ModelConstant.NO_CHECK_RESULT_STR);
            checkCommNum = NUM_ZERO;
        }
        this.checkCommNum = checkCommNum;
    }

}
